package com.back.demo.service;

import com.back.demo.mapper.BasicMapper;
import com.back.demo.mapper.myDO.User;
import org.springframework.beans.factory.annotation.Autowired;

@org.springframework.stereotype.Service
public class BasicService {
    @Autowired
    private BasicMapper basicMapper;

    public User findPasswordByUsername(String username) {
        return basicMapper.selectPasswordByUsername(username);
    }

    public void register(User user) {
        basicMapper.insert(user);
    }

    public User findNameByUsername(String username) {
        return basicMapper.selectNameByUsername(username);
    }

    public User findInformationByUsername(String username) {
        return basicMapper.selectInformationByUsername(username);
    }

    public void changePassword(String username, String newPassword) {
        basicMapper.changePassword(username, newPassword);
    }

    public void changeInformation(String username, String phone, String email) {
        basicMapper.changeInformation(username, phone, email);
    }

}
